home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / umich / falcon / programm.ing / falclib.lzh / EXAMPLE / GEMSTUF2.S < prev    next >
Text File  |  1994-08-17  |  2KB  |  105 lines

  1. *********************************************************
  2. *                            *
  3. * A window demonstration                *
  4. *                            *
  5. *********************************************************
  6.  
  7.         include    releasem.s    release unused memory
  8.         include    getpar.s    find where the parameters are kept
  9.         move.l    a0,parbuf    save it
  10.  
  11.         bra    main
  12.         include    gemmacro.i    this one is supplied with devpac
  13.         include    shrtones.s
  14.         include    window.s
  15.  
  16. wtype        equ    %01111        info, move, full, close and name
  17. windowname    dc.b    'hello world',0
  18.  
  19. main        move    #32,xstart    window start position
  20.         move    #50,ystart
  21.         move    #380,xwidth    window size
  22.         move    #150,ywidth
  23.         bsr    @createwindow
  24.  
  25.         menu_register ap_id,#applname    ; set the name of the application
  26.  
  27. wait        evnt_multi #%010010,#1,#1,#1,#0,#0,#0,#0,#0,#0,#0,#0,#0,#0,#msgbuf,#0    ;get message and button events
  28.         btst.b    #4,int_out+1
  29.         bne    msgevent
  30. msgready    btst.b    #1,int_out+1
  31.         bne    buttonevent
  32.         bra    wait
  33.         
  34. msgevent    move    msgbuf,d0
  35.         cmp    #20,d0        is it an update event?
  36.         beq    redraw
  37.         cmp    #22,d0        was the close box pressed?
  38.         beq    exit
  39.         cmp    #28,d0        was the window moved?
  40.         beq    moved
  41.         cmp    #23,d0        was the full button pressed
  42.         beq    full
  43.         cmp    #21,d0        was the window topped?
  44.         beq    topped
  45.         cmp    #33,d0        was it bottomed?
  46.         beq    bottomed
  47.         bra    msgready    it was something unimportant
  48.         
  49. buttonevent    lea    rsrc,a0
  50.         bsr    @button
  51.         cmp    #1,d0        did someone press my button?
  52.         beq    button1        yes!
  53.         bra    wait        nothing of importance was clicked on
  54.  
  55. button1        form_alert alertbutton,#alerttext
  56.         bra    wait
  57.     
  58. exit        bsr    @exitwindow
  59.         bra    @quit
  60.  
  61. redraw        move.l    #rsrc,a0
  62.         bsr    @updatersrc
  63.         bra    msgready
  64.     
  65. moved        lea    msgbuf,a0
  66.         bsr    @moveit
  67.         bra    msgready
  68.     
  69. bottomed    lea    msgbuf,a0
  70.         bsr    @bottomwindow
  71.         bra    msgready
  72.     
  73. topped        lea    msgbuf,a0
  74.         bsr    @topwindow
  75.         bra    msgready
  76.  
  77. full        fsel_exinput #path,#filen,#title
  78.         bra    msgready
  79.  
  80.  
  81.  
  82. rsrc        dc.w    -1,1,1,20,0,0,4,1,0,0,380,150
  83.         dc.w    0,-1,-1,26,1,0
  84.         dc.l    buttontext
  85.         dc.w    50,50,100,16
  86.  
  87. path        dc.b    'c:\*.*',0
  88.         ds.b    150
  89. filen        ds.b    20
  90. title        dc.b    'load a file or something',0
  91. buttontext    dc.b    'a button',0
  92.         even
  93. alertbutton    dc.w    1
  94. alerttext    dc.b    '[2][You have not saved anything|are you sure you want to quit?][    Yes    ]',0
  95. applname    dc.b    '  here I am',0
  96.  
  97.         include    aeslib.s    supplied with devpac
  98.         include    vdilib.s    supplied with devpac
  99.         
  100.         section bss
  101.  
  102. msgbuf        ds.w    20
  103. parbuf        ds.l    1
  104.  
  105.